package com.rgp.serviceprice.controller;

import com.rgp.internalcommon.dto.OrderPriceDto;
import com.rgp.internalcommon.dto.ResponseResult;
import com.rgp.serviceprice.service.CalculatePriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;

/**
 * @author nhp
 * @version 1.0
 * @description TODO
 * @date 2024-04-26 18:21
 */
@RestController
public class CalculatePriceController {

    @Autowired
    private CalculatePriceService calculatePriceService;

    @PostMapping("/order/calculate-price")
    public ResponseResult<BigDecimal> calculateOrderPrice(@RequestBody OrderPriceDto orderPriceDto){
        return calculatePriceService.calculateOrderPrice(orderPriceDto);
    }
}
